Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@octokit/openapi-types
Advanced tools
Generated TypeScript definitions based on GitHub's OpenAPI spec for api.github.com
The @octokit/openapi-types npm package provides TypeScript definitions based on GitHub's OpenAPI specification. This package is useful for developers working with GitHub's REST API, as it offers type definitions that can help ensure that API requests and responses are correctly structured according to the GitHub API schema.
Type Definitions for GitHub API
This code sample demonstrates how to use the type definitions for GitHub API objects provided by @octokit/openapi-types. In this example, we define an 'issue' object with properties that match the expected structure of a GitHub issue according to the API's schema.
import { components } from '@octokit/openapi-types';
const issue: components['schemas']['issue'] = {
id: 1,
number: 1347,
state: 'open',
title: 'Found a bug',
body: 'I'm having a problem with this.',
user: {
login: 'octocat',
id: 1,
node_id: 'MDQ6VXNlcjE=',
avatar_url: 'https://github.com/images/error/octocat_happy.gif',
gravatar_id: '',
url: 'https://api.github.com/users/octocat',
html_url: 'https://github.com/octocat',
followers_url: 'https://api.github.com/users/octocat/followers',
following_url: 'https://api.github.com/users/octocat/following{/other_user}',
gists_url: 'https://api.github.com/users/octocat/gists{/gist_id}',
starred_url: 'https://api.github.com/users/octocat/starred{/owner}{/repo}',
subscriptions_url: 'https://api.github.com/users/octocat/subscriptions',
organizations_url: 'https://api.github.com/users/octocat/orgs',
repos_url: 'https://api.github.com/users/octocat/repos',
events_url: 'https://api.github.com/users/octocat/events{/privacy}',
received_events_url: 'https://api.github.com/users/octocat/received_events',
type: 'User',
site_admin: false
}
};
This package provides TypeScript definitions for the Octokit libraries. It is similar to @octokit/openapi-types but focuses more broadly on the types used across various Octokit libraries rather than strictly adhering to GitHub's OpenAPI specification.
While not directly similar, swagger-jsdoc is a tool that allows developers to integrate Swagger using JSDoc comments directly in their code. It serves a similar purpose in creating API documentation and could be used in conjunction with type definitions for designing robust APIs.
Generated TypeScript definitions based on GitHub's OpenAPI spec
This package is continously updated based on GitHub's OpenAPI specification
import { components } from "@octokit/openapi-types";
type Repository = components["schemas"]["full-repository"];
FAQs
Generated TypeScript definitions based on GitHub's OpenAPI spec for api.github.com
The npm package @octokit/openapi-types receives a total of 13,290,222 weekly downloads. As such, @octokit/openapi-types popularity was classified as popular.
We found that @octokit/openapi-types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.